<?php 
$this->headLink(array('href' => '/cms/styles/style.css', 'rel' => "stylesheet", 'type' => "text/css"));
$this->headStyle(<<<EOD
#selectBox {
	overflow: auto;
	height: 200px;
	width: 300px;
	border: 1px solid #333333;
}
#selectBox ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#selectBox ul li {
	padding-top: 4px;
	padding-right: 3px;
	padding-bottom: 4px;
	padding-left: 3px;
	background-color: #E9E9E9;
	margin-top: 2px;
	margin-right: 3px;
	margin-bottom: 2px;
	margin-left: 3px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
#selectBox ul li.selected {
	border: 1px solid #000000;
	margin-top: 1px;
	margin-right: 2px;
	margin-bottom: 1px;
	margin-left: 2px;
}
.checkboxBox {
	float: left;
}
.labelBox {
	padding-left: 30px;
	padding-top: 4px;
}
EOD
);


$this->headScript(Zend_View_Helper_HeadScript::SCRIPT, <<<EOD

window.onload = function () {
		var appendActions = function (liNode) {
					liNode.onmouseover = function () { liNode.className = 'selected'; }
					liNode.onmouseout = function () { liNode.className = ''; }
				};
		var liNodes = document.getElementById('selectBox').getElementsByTagName('LI');
		for (var l=0;l<liNodes.length;l++) {
			appendActions(liNodes.item(l));
		}
	}
EOD
);
$this->layout()->body_attr = 'class="modal"';
?>
<h1>Привязка к категориям</h1>
<form id="form1" name="form1" method="post" action="">
  <div id="selectBox">
  <?= $this->partial('catalog/categorylink-list.phtml',
  	array(
  		'categories' => $this->categories,
  		'checked_categories' => $this->checked_categories
  	)) ?>
  </div>
  <div style="padding-top:20px"><input type="submit" class="okButton" id="okButton" value="Сохранить" />
    <input type="button" class="okButton" value="Отмена" onclick="window.parent.setTimeout('Shadowbox.close()',10)" /></div>
</form>